package tw.com.msig.jaxb;

import java.net.URL;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

public class Jaxb02App {

	public static void main(String[] args) {
		URL url = Jaxb02App.class.getClassLoader().getResource("mapping/City.hbm.xml");
		System.out.println(url);
		
		try {
			JAXBContext jc = JAXBContext.newInstance(HibernateMapping.class);
			Unmarshaller unmarshaller = jc.createUnmarshaller();
			HibernateMapping hibernateMapping = (HibernateMapping) unmarshaller.unmarshal(url);
			
			System.out.println("hibernateMapping:" + hibernateMapping);
			
		} catch (JAXBException e) {
			e.printStackTrace();
		}
	}

}
